/**
** This file is part of the KzLib.
** Developed Individually.
** All Rights Reserved.
** Unauthorized copying of this file, via any medium is strictly prohibited
** Proprietary and confidential
**
** Copyright 2022-12-03 Raiiwhen masterraii@icloud.com
** All rights reserved.
**/

#ifndef DRV_DIGITALTUBE_H_
#define DRV_DIGITALTUBE_H_

#include <stdint.h>

#define DIG_ON 1
#define DIG_OFF 0
#define DIG_CH_SIZE 3

typedef void (*drvDigitalTubeIO)(uint8_t isSet);
typedef struct 
{
    drvDigitalTubeIO digA;
    drvDigitalTubeIO digB;
    drvDigitalTubeIO digC;
    drvDigitalTubeIO digD;
    drvDigitalTubeIO digE;
    drvDigitalTubeIO digF;
    drvDigitalTubeIO digG;
    drvDigitalTubeIO digDP;
    drvDigitalTubeIO digEn[DIG_CH_SIZE];
    int num[DIG_CH_SIZE];
    int timePeriod[DIG_CH_SIZE];
    int timeCnt;
    int digPos;
} drvDigitalTube;

void drvDigitalTubeTest(const drvDigitalTube* pTubeIO);
void drvDigitalTubeShowInt(const drvDigitalTube* pTubeIO, int num);
void drvDigitalTubeShowFloat(drvDigitalTube* pTubeIO, float floatNumber);
void drvDigitalTubeClear(drvDigitalTube* pTubeIO);
int isDrvDigitalTubeDisplayDone(const drvDigitalTube* pTubeIO);
void drvDigitalTubeShowOFF(drvDigitalTube* pTubeIO);

#endif
